package com.etc.utils;
/*
 * 文件名：
 * 描述：用户往百度云注册人脸
 * 作者：黄志鹏
 * 时间：2019-5-27 09:19:00
 */

import java.net.URLEncoder;

public class AddFace {
	public static String add(String imgStr,String id) {
		String token = "24.729ee759cc180f9db37e7d97b1eebd51.2592000.1561512967.282335-15832700";
		try {
			String imgParam = URLEncoder.encode(imgStr, "UTF-8");
			String param = "&image=" + imgParam + "&image_type=BASE64&group_id=group0001&user_id=user_"+id;
			String result = HttpUtil.post("https://aip.baidubce.com/rest/2.0/face/v3/faceset/user/add", token, param);
			/*System.out.println(result.toString());*/
			return result.toString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}